<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var userList =["zhangsan","lisi","wangwu"];
   /*  arr.shift()删除数组的第一个元素，数组的长度减1
    返回值为被删除的数组元素 */
  

    
 /*      arr.pop()删除数组的最后一个元素 */


    var result =userList.shift();
    /* while(userList.length>0){
        userList.shift();
    } */                   //yo可以用来清空
    console.log(result);
    console.log(userList);
    </script>
</html>